#
# Sid Meier's Civilization 4
# Copyright Firaxis Games 2005
# < edited by the ViSa Modpack Team >

##############################################################################################
##############################################################################################
##############################################################################################
##########                                                                         ###########
##########                                 WARNING                                 ###########
##########                                                                         ###########
##########      do NOT alter anything in this file without altering the SDK        ###########
##########                                                                         ###########
##############################################################################################
##############################################################################################
##############################################################################################

from CvPythonExtensions import *
import CvUtil
import ScreenInput
import CvScreenEnums
import string
import CvScreensInterface

import CvConfigParser

# globals
gc = CyGlobalContext()
ArtFileMgr = CyArtFileMgr()
localText = CyTranslator()

# <GS Start>

# Change this to have the legal civic option bureaucracy give free statemen to 
# civilizations that have the legal civic option bureaucracy set. The free 
# statesmen are added to the civilization's capital city.
# Default value is true
g_bBureaucracyCivicAddsStatesmen = true

# Change this to increase or decrease the number of free statesmen that are 
# added to a civilization's capital city if they select bureaucracy as their 
# legal civic option.
# Default value is 2
g_iBureaucracyStatesmanBonus = 2

# <GS End> 

class CvCivicsScreen:

	#################################################
	## Mrgenie CivicScreenTweaks BEGIN
	#################################################

	def __init__(self):
		self.SCREEN_NAME = "CivicsScreen"
		self.CANCEL_NAME = "CivicsCancel"
		self.EXIT_NAME = "CivicsExit"
		self.TITLE_NAME = "CivicsTitleHeader"
		self.TITLE_TOP_PANEL = "CivicsTopPanel"
		self.TITLE_BOTTOM_PANEL = "CivicsBottomPanel"
		self.BUTTON_NAME = "CivicsScreenButton"
		self.TEXT_NAME = "CivicsScreenText"
		self.AREA_NAME = "CivicsScreenArea"
		self.HELP_AREA_NAME = "CivicsScreenHelpArea"
		self.HELP_IMAGE_NAME = "CivicsScreenCivicOptionImage"
		self.DEBUG_DROPDOWN_ID =  "CivicsDropdownWidget"
		self.BACKGROUND_ID = "CivicsBackground"
		self.HELP_HEADER_NAME = "CivicsScreenHeaderName"

		self.CivicsScreenInputMap = {
			self.BUTTON_NAME	: self.CivicsButton,
			self.TEXT_NAME		: self.CivicsButton,
			self.EXIT_NAME		: self.Revolution,
			self.CANCEL_NAME	: self.Cancel}

		self.iActivePlayer = -1

		self.m_paeCurrentCivics = []
		self.m_paeDisplayCivics = []
		self.m_paeOriginalCivics = []
		
		# <GS Start>
		global g_bBureaucracyCivicAddsStatesmen
		global g_iBureaucracyStatesmanBonus
		config = CvConfigParser.CvConfigParser("ViSa_v3.ini")
		
		# Read the configuration values for the great statesman
		if(config != None):
			g_bBureaucracyCivicAddsStatesmen = config.getboolean("Great Statesman", "Bureaucracy Civic Adds Statesmen", true)
			g_iBureaucracyStatesmanBonus = config.getint("Great Statesman", "Bureaucracy Statesman Bonus", 2)
		
		# <GS End>

		self.HEADINGS_TOP = 0
		self.HEADINGS_BOTTOM = 220
		self.HELP_TOP = 350
		self.HELP_BOTTOM = 610
		self.BUTTON_SIZE = 24
		self.BIG_BUTTON_SIZE = 64
		self.BOTTOM_LINE_TOP = 630
		self.BOTTOM_LINE_HEIGHT = 60
		self.Y_EXIT = 726
		self.Y_CANCEL = 726
		self.Y_SCREEN = 396
		self.H_SCREEN = 768
		self.Z_SCREEN = -6.1
		self.Y_TITLE = 8		
		self.Z_TEXT = self.Z_SCREEN - 0.2
		self.TEXT_MARGIN = 13			# original = 15



	def setValues(self):
		screen = CyGInterfaceScreen("MainInterface", CvScreenEnums.MAIN_INTERFACE)
		resolutionWidth = screen.getXResolution()
		resolutionHeigth = screen.getYResolution()

## below checks for resolution are disabled because the top panels are static, need to be because the nr of civics cant change either way
## and the lower panels automatically adjust to screenresolution, the horizontal resolution is unimportant either way because the whole screen is
## made scrollable
#		if (resolutionWidth >= 1440):
#			self.HEADINGS_WIDTH = 204	# original = 199
#			self.X_SCREEN = 718		# original = 500
#			self.X_CANCEL = 717		# original = 552

#		elif (resolutionWidth >= 1280):
#			self.W_SCREEN = 1280
#			self.HEADINGS_WIDTH = 182
#			self.X_SCREEN = 638
#			self.X_CANCEL = 637

#		elif (resolutionWidth >= 1152):
#			self.W_SCREEN = 1152
#			self.HEADINGS_WIDTH = 164
#			self.X_SCREEN = 574
#			self.X_CANCEL = 573

#		elif (resolutionWidth >= 1024):
#			self.W_SCREEN = 1024
#			self.HEADINGS_WIDTH = 146
#			self.X_SCREEN = 510
#			self.X_CANCEL = 509



		self.H_SCREEN = resolutionHeigth
		self.W_SCREEN = resolutionWidth

		self.X_CANCEL = 20
		self.X_POSITION = 0
		self.Y_POSITION = 0		
		self.PANEL_HEIGHT = 55
		self.INITIAL_SPACING = 0		
		self.HEADINGS_WIDTH = 340		
		self.BOTTOM_LINE_HEIGHT = 60
		self.SCROLL_BAR_SPACING = 40
		
		self.X_SCREEN = self.W_SCREEN / 2		 
		self.Y_CANCEL = self.H_SCREEN - 40
		self.Y_EXIT = self.H_SCREEN - 40
		self.HELP_BOTTOM = self.H_SCREEN - 2 * self.PANEL_HEIGHT - self.BOTTOM_LINE_HEIGHT
		
		self.BOTTOM_LINE_WIDTH = self.W_SCREEN
		self.BOTTOM_LINE_TOP = self.H_SCREEN - self.PANEL_HEIGHT - 70		
		self.X_EXIT = self.W_SCREEN - 30

	#################################################
	## Mrgenie CivicScreenTweaks END
	#################################################



	def getScreen(self):
		return CyGInterfaceScreen(self.SCREEN_NAME, CvScreenEnums.CIVICS_SCREEN)



	def setActivePlayer(self, iPlayer):
		self.iActivePlayer = iPlayer
		activePlayer = gc.getPlayer(iPlayer)

		self.m_paeCurrentCivics = []
		self.m_paeDisplayCivics = []
		self.m_paeOriginalCivics = []
		for i in range (gc.getNumCivicOptionInfos()):
			self.m_paeCurrentCivics.append(activePlayer.getCivics(i))
			self.m_paeDisplayCivics.append(activePlayer.getCivics(i))
			self.m_paeOriginalCivics.append(activePlayer.getCivics(i))



	def interfaceScreen (self):
		# Mrgenie CivicScreenTweaks LINE:
		self.setValues()
		screen = self.getScreen()
		if screen.isActive():
			return
		screen.setRenderInterfaceOnly(True);
		screen.showScreen( PopupStates.POPUPSTATE_IMMEDIATE, False)

		# Mrgenie CivicScreenTweaks LINE:		
		screen.setDimensions(self.X_POSITION, self.Y_POSITION, self.W_SCREEN * 2, self.H_SCREEN)
		screen.addDDSGFC(self.BACKGROUND_ID, ArtFileMgr.getInterfaceArtInfo("MAINMENU_SLIDESHOW_LOAD").getPath(), 0, 0, self.W_SCREEN * 2, self.H_SCREEN, WidgetTypes.WIDGET_GENERAL, -1, -1 )

		## Panels on the Top(name of screen) and bottom(Cancel, Exit, Revolution buttons)
		screen.addPanel( self.TITLE_TOP_PANEL, u"", u"", True, False, 0, 0, self.W_SCREEN * 2, self.PANEL_HEIGHT, PanelStyles.PANEL_STYLE_TOPBAR )
		screen.addPanel( self.TITLE_BOTTOM_PANEL, u"", u"", True, False, 0, self.H_SCREEN - self.PANEL_HEIGHT, self.W_SCREEN * 2, self.PANEL_HEIGHT, PanelStyles.PANEL_STYLE_BOTTOMBAR )
		screen.showWindowBackground(False)

		## set the standard "exit" text, other text "cancel, revolution" are handled at the bottom in this python file		
		screen.setText(self.CANCEL_NAME, "Background", u"<font=4>" + localText.getText("TXT_KEY_SCREEN_CANCEL", ()).upper() + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, self.X_CANCEL, self.Y_CANCEL, self.Z_TEXT, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, 1, 0)
		

		# Header...
		screen.setText(self.TITLE_NAME, "Background", u"<font=4b>" + localText.getText("TXT_KEY_CIVICS_SCREEN_TITLE", ()).upper() + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, self.X_SCREEN, self.Y_TITLE, self.Z_TEXT, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
		
		self.setActivePlayer(gc.getGame().getActivePlayer())						

		if (CyGame().isDebugMode()):
			self.szDropdownName = self.DEBUG_DROPDOWN_ID
			screen.addDropDownBoxGFC(self.szDropdownName, 22, 12, 300, WidgetTypes.WIDGET_GENERAL, -1, -1, FontTypes.GAME_FONT)
			for j in range(gc.getMAX_PLAYERS()):
				if (gc.getPlayer(j).isAlive()):
					screen.addPullDownString(self.szDropdownName, gc.getPlayer(j).getName(), j, j, False )

		# Mrgenie Civic Screen info panel(shows upkeep and turns for revolution):
		screen.addPanel("CivicsBottomLine", "", "", True, True, self.INITIAL_SPACING, self.BOTTOM_LINE_TOP, self.BOTTOM_LINE_WIDTH, self.BOTTOM_LINE_HEIGHT, PanelStyles.PANEL_STYLE_MAIN)

		# Make the scrollable area for the civics list...
		screen.addScrollPanel( "CivicList", u"", 0, self.PANEL_HEIGHT, self.W_SCREEN , self.H_SCREEN - 2 * self.PANEL_HEIGHT - self.BOTTOM_LINE_HEIGHT - self.SCROLL_BAR_SPACING, PanelStyles.PANEL_STYLE_EXTERNAL )
		screen.setActivation( "CivicList", ActivationTypes.ACTIVATE_NORMAL )
		

		# Draw Contents
		self.drawContents()


		return 0

	# Draw the contents...
	def drawContents(self):
	
		# Draw the radio buttons
		self.drawAllButtons()
				
		# Draw Help Text
		self.drawAllHelpText()
		
		# Update Maintenance/anarchy/etc.
		self.updateAnarchy()

	def drawCivicOptionButtons(self, iCivicOption):

		activePlayer = gc.getPlayer(self.iActivePlayer)
		screen = self.getScreen()
		
		for j in range(gc.getNumCivicInfos()):

			if (gc.getCivicInfo(j).getCivicOptionType() == iCivicOption):										
				screen.setState(self.getCivicsButtonName(j), self.m_paeCurrentCivics[iCivicOption] == j)
							
				if (self.m_paeDisplayCivics[iCivicOption] == j):
					#screen.setState(self.getCivicsButtonName(j), True)
					screen.show(self.getCivicsButtonName(j))
				elif (activePlayer.canDoCivics(j)):
					#screen.setState(self.getCivicsButtonName(j), False)
					screen.show(self.getCivicsButtonName(j))
				else:
					screen.hide(self.getCivicsButtonName(j))

	# Will draw the radio buttons (and revolution)
	def drawAllButtons(self):

		for i in range(gc.getNumCivicOptionInfos()):

			screen = self.getScreen()
                        
			# Mrgenie CivicScreenTweaks LINE:
			fX = self.INITIAL_SPACING + (self.HEADINGS_WIDTH * i)
			fY = self.HEADINGS_TOP

			## draw the Top Screen panels for the civics
			szAreaID = self.AREA_NAME + str(i)			
			screen.attachPanelAt( "CivicList", szAreaID, u"", u"", True, True, PanelStyles.PANEL_STYLE_MAIN, fX, fY, self.HEADINGS_WIDTH, self.HEADINGS_BOTTOM - self.HEADINGS_TOP, WidgetTypes.WIDGET_GENERAL, i, -1 )
			

			## draw the civic category(government, labor, ...)
			szCivicID = "CivicID" + str(i)
			screen.setTextAt( szCivicID, "CivicList", u"<font=4>" + gc.getCivicOptionInfo(i).getDescription().upper() + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, fX + self.HEADINGS_WIDTH / 4, fY + 6, 0, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, i, -1 )
			screen.setActivation( szCivicID, ActivationTypes.ACTIVATE_MIMICPARENTFOCUS)
			

			fY += 3 * self.TEXT_MARGIN

			for j in range(gc.getNumCivicInfos()):
				if (gc.getCivicInfo(j).getCivicOptionType() == i):
					## draw the checkbox icon for each civic
					screen.addCheckBoxGFCAt( "CivicList", self.getCivicsButtonName(j), gc.getCivicInfo(j).getButton(), ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(), fX + 12, fY, self.BUTTON_SIZE, self.BUTTON_SIZE, WidgetTypes.WIDGET_GENERAL, -1, -1, ButtonStyles.BUTTON_STYLE_LABEL )
					screen.setActivation( self.getCivicsButtonName(j), ActivationTypes.ACTIVATE_NORMAL )
					screen.hide (self.getCivicsButtonName(j) )

					## draw the civic names
					screen.setTextAt( self.getCivicsTextName(j), "CivicList", u"<font=3>   -   " + gc.getCivicInfo(j).getDescription() + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + 12 + self.BUTTON_SIZE + 10 , fY, 0, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )

					## make sure the next line is put down under the previous
					fY += 2 * self.TEXT_MARGIN + 1

			self.drawCivicOptionButtons(i)
			

	def highlight(self, iCivic):
		iCivicOption = gc.getCivicInfo(iCivic).getCivicOptionType()
		if self.m_paeDisplayCivics[iCivicOption] != iCivic:
			self.m_paeDisplayCivics[iCivicOption] = iCivic
			self.drawCivicOptionButtons(iCivicOption)
			return True
		return False
		
	def unHighlight(self, iCivic):		
		iCivicOption = gc.getCivicInfo(iCivic).getCivicOptionType()
		if self.m_paeDisplayCivics[iCivicOption] != self.m_paeCurrentCivics[iCivicOption]:
			self.m_paeDisplayCivics[iCivicOption] = self.m_paeCurrentCivics[iCivicOption]
			self.drawCivicOptionButtons(iCivicOption)
			return True
		return False
		
	def select(self, iCivic):
		activePlayer = gc.getPlayer(self.iActivePlayer)
		if (not activePlayer.canDoCivics(iCivic)):
			# If you can't even do this, get out....
			return 0
			
		iCivicOption = gc.getCivicInfo(iCivic).getCivicOptionType()
		
		# Set the previous widget
		iCivicPrev = self.m_paeCurrentCivics[iCivicOption]
		
		# Switch the widgets
		self.m_paeCurrentCivics[iCivicOption] = iCivic
		
		# Unighlight the previous widget
		self.unHighlight(iCivicPrev)
		self.getScreen().setState(self.getCivicsButtonName(iCivicPrev), False)

		# highlight the new widget
		self.highlight(iCivic)		
		self.getScreen().setState(self.getCivicsButtonName(iCivic), True)
		
		return 0

	def CivicsButton(self, inputClass):
	
		if (inputClass.getNotifyCode() == NotifyCode.NOTIFY_CLICKED) :
			if (inputClass.getFlags() & MouseFlags.MOUSE_RBUTTONUP):
				CvScreensInterface.pediaJumpToCivic((inputClass.getID(), ))
			else:
				# Select button
				self.select(inputClass.getID())
				self.drawHelpText(gc.getCivicInfo(inputClass.getID()).getCivicOptionType())
				self.updateAnarchy()
		elif (inputClass.getNotifyCode() == NotifyCode.NOTIFY_CURSOR_MOVE_ON) :
			# Highlight this button
			if self.highlight(inputClass.getID()):
				self.drawHelpText(gc.getCivicInfo(inputClass.getID()).getCivicOptionType())
				self.updateAnarchy()
		elif (inputClass.getNotifyCode() == NotifyCode.NOTIFY_CURSOR_MOVE_OFF) :
			if self.unHighlight(inputClass.getID()):
				self.drawHelpText(gc.getCivicInfo(inputClass.getID()).getCivicOptionType())
				self.updateAnarchy()

		return 0

		
	def drawHelpText(self, iCivicOption):
		
		activePlayer = gc.getPlayer(self.iActivePlayer)
		iCivic = self.m_paeDisplayCivics[iCivicOption]

		## every screenname must be unique, also the text boxes, because of the way how civ is using the "setTextAt"
		## command, every single string is forced to be parsed seperatly, a loop would just put all the
		## strings behind each other in 1 very long sentence without 'newline' chars
		szPaneID = "CivicsHelpTextBackground" + str(iCivicOption)
		szPaneIDUpkeep = "Upkeep" + str(iCivicOption)
		szPaneIDTechPrereq = "TechPrereq" + str(iCivicOption)
		szPaneIDInfoBuildingNotRequired = "InfoBuildingNotRequired" + str(iCivicOption)
		szPaneIDNumSpecialistInfos = "NumSpecialistInfos" + str(iCivicOption)
		szPaneIDGreatPeopleRateModifier = "GreatPeopleRateModifier" + str(iCivicOption)
		szPaneIDGreatGeneralRateModifier = "GreatGeneralRateModifier" + str(iCivicOption)
		szPaneIDDomesticGreatGeneralRateModifier = "DomesticGreatGeneralRateModifier" + str(iCivicOption)
		szPaneIDStateReligionGreatPeopleRateModifier = "StateReligionGreatPeopleRateModifier" + str(iCivicOption)
		szPaneIDDistanceMaintenanceModifier = "DistanceMaintenanceModifier" + str(iCivicOption)
		szPaneIDNumCitiesMaintenanceModifier = "NumCitiesMaintenanceModifier" + str(iCivicOption)
		szPaneIDExtraHealth = "ExtraHealth" + str(iCivicOption)
		szPaneIDFreeExperience = "FreeExperience" + str(iCivicOption)
		szPaneIDWorkerSpeedModifier = "WorkerSpeedModifier" + str(iCivicOption)
		szPaneIDImprovementUpgradeRateModifier = "ImprovementUpgradeRateModifier" + str(iCivicOption)
		szPaneIDImprovementUpgradeRateModifierAppend_1 = "ImprovementUpgradeRateModifierAppend_1" + str(iCivicOption)
		szPaneIDImprovementUpgradeRateModifierAppend_2 = "ImprovementUpgradeRateModifierAppend_2" + str(iCivicOption)		
		szPaneIDMilitaryProductionModifier = "MilitaryProductionModifier" + str(iCivicOption)
		szPaneIDFreeUnitsPopulationPercent = "FreeUnitsPopulationPercent" + str(iCivicOption)
		szPaneIDBaseFreeMilitaryUnits = "BaseFreeMilitaryUnits" + str(iCivicOption)
		szPaneIDHappyPerMilitaryUnit = "HappyPerMilitaryUnit" + str(iCivicOption)
		szPaneIDMilitaryFoodProduction = "MilitaryFoodProduction" + str(iCivicOption)
		szPaneIDWorldSizeMaxConscript = "WorldSizeMaxConscript" + str(iCivicOption)
		szPaneIDNoUnhealthyPopulation = "NoUnhealthyPopulation" + str(iCivicOption)
		szPaneIDBuildingOnlyHealthy = "BuildingOnlyHealthy" + str(iCivicOption)
		szPaneIDExpInBorderModifier = "ExpInBorderModifier" + str(iCivicOption)
		szPaneIDWarWearinessModifier = "WarWearinessModifier" + str(iCivicOption)
		szPaneIDFreeSpecialist = "FreeSpecialist" + str(iCivicOption)
		szPaneIDTradeRoutes = "TradeRoutes" + str(iCivicOption)
		szPaneIDNoForeignTrade = "NoForeignTrade" + str(iCivicOption)
		szPaneIDCivicPercentAnger = "CivicPercentAnger" + str(iCivicOption)
		szPaneIDStateReligion = "StateReligion" + str(iCivicOption)
		szPaneIDStateReligionHappiness = "StateReligionHappiness" + str(iCivicOption)
		szPaneIDNonStateReligionHappiness = "NonStateReligionHappiness" + str(iCivicOption)
		szPaneIDStateReligionUnitProductionModifier = "StateReligionUnitProductionModifier" + str(iCivicOption)
		szPaneIDStateReligionBuildingProductionModifier = "StateReligionBuildingProductionModifier" + str(iCivicOption)
		szPaneIDNoStateReligionBuildingProductionModifier = "NoStateReligionBuildingProductionModifier" + str(iCivicOption)
		szPaneIDNoStateReligionBuildingProductionModifierAppend = "NoStateReligionBuildingProductionModifierAppend" + str(iCivicOption)
		szPaneIDStateReligionFreeExperience = "StateReligionFreeExperience" + str(iCivicOption)
		szPaneIDNoNonStateReligionSpread = "NoNonStateReligionSpread" + str(iCivicOption)
		szPaneIDCityGuardModifier = "CityGuardModifier" + str(iCivicOption)
		szPaneIDNoTechLeak = "NoTechLeak"  + str(iCivicOption)
		szPaneIDYieldChangeHelpAllCities = "YieldChangeHelpAllCities" + str(iCivicOption)
		szPaneIDYieldChangeHelpCapital = "YieldChangeHelpCapital" + str(iCivicOption)
		szPaneIDYieldChangeHelpTradeRoutes = "YieldChangeHelpTradeRoutes" + str(iCivicOption)
		szPaneIDCommerceChangeHelpAllCities = "CommerceChangeHelpAllCities" + str(iCivicOption)
		szPaneIDCommerceChangeHelpCapital = "CommerceChangeHelpCapital" + str(iCivicOption)
		szPaneIDCommerceChangeHelpSpecialist = "CommerceChangeHelpSpecialist" + str(iCivicOption)
		szPaneIDLargestCityHappiness = "LargestCityHappiness" + str(iCivicOption)
		szPaneIDNumImprovementInfosYield1Row1 = "NumImprovementInfosYield1Row1" + str(iCivicOption)
		szPaneIDNumImprovementInfosYield1Row2 = "NumImprovementInfosYield1Row2" + str(iCivicOption)
		szPaneIDNumImprovementInfosYield2Row1 = "NumImprovementInfosYield2Row1" + str(iCivicOption)
		szPaneIDNumImprovementInfosYield2Row2 = "NumImprovementInfosYield2Row2" + str(iCivicOption)
		szPaneIDNumImprovementInfosYield3Row1 = "NumImprovementInfosYield3Row1" + str(iCivicOption)
		szPaneIDNumImprovementInfosYield3Row2 = "NumImprovementInfosYield3Row2" + str(iCivicOption)
		szPaneIDInquisition = "Inquisition" + str(iCivicOption)
		szPaneIDInquisitionAppend1 = "InquisitionAppend1" + str(iCivicOption)
		szPaneIDInquisitionAppend2 = "InquisitionAppend2" + str(iCivicOption)
		szPaneIDInquisitionAppend3 = "InquisitionAppend3" + str(iCivicOption)
		szPaneIDBuildingCivicPrereq = "BuildingCivicPrereq" + str(iCivicOption)
		szPaneIDBuildingCivicPrereqAppend1 = "BuildingCivicPrereqAppend1" + str(iCivicOption)
		szPaneIDBuildingCivicPrereqAppend2 = "BuildingCivicPrereqAppend2" + str(iCivicOption)
		szPaneIDBuildingCivicPrereqAppend3 = "BuildingCivicPrereqAppend3" + str(iCivicOption)
		szPaneIDNumBuildingInfos = "NumBuildingInfos" + str(iCivicOption)
		szPaneIDNumBuildingInfosAppend_1 = "NumBuildingInfosAppend_1" + str(iCivicOption)
		szPaneIDNumBuildingInfosAppend_2 = "NumBuildingInfosAppend_2" + str(iCivicOption)
		szPaneIDNumBuildingInfosAppend_3 = "NumBuildingInfosAppend_3" + str(iCivicOption)
		szPaneIDNumBuildingInfosAppend_4 = "NumBuildingInfosAppend_4" + str(iCivicOption)
		szPaneIDNumBuildingInfosAppend_5 = "NumBuildingInfosAppend_5" + str(iCivicOption)
		szPaneIDNumFeatureInfos = "NumFeatureInfos" + str(iCivicOption)
		szPaneIDNumHurryInfos = "NumHurryInfos" + str(iCivicOption)
		szPaneIDGoldPerUnit = "GoldPerUnit" + str(iCivicOption)
		szPaneIDGoldPerMilitaryUnit = "GoldPerMilitaryUnit" + str(iCivicOption)
		szPaneIDBureaucracyCivicAddsStatesmen = "BureaucracyCivicAddsStatesmen"  + str(iCivicOption)


		
		screen = self.getScreen()
		## make sure the string is empty, not needed really, but to be sure
		szHelpText = u""

		## spacing for the blue background help panel
		fX = self.INITIAL_SPACING + (self.HEADINGS_WIDTH * iCivicOption)		
		fY = self.HELP_TOP - self.PANEL_HEIGHT + 2 * self.TEXT_MARGIN

		## draw the blue panels
		szHelpAreaID = self.HELP_AREA_NAME + str(iCivicOption)
		screen.attachPanelAt( "CivicList", szHelpAreaID, u"", u"", True, True, PanelStyles.PANEL_STYLE_MAIN, fX, self.HELP_TOP - self.PANEL_HEIGHT, self.HEADINGS_WIDTH, self.HELP_BOTTOM - self.HELP_TOP, WidgetTypes.WIDGET_GENERAL, -1, -1 )

		## spacing for the help strings
		fX = self.INITIAL_SPACING + (self.HEADINGS_WIDTH * iCivicOption)


		# Upkeep string
		if ((gc.getCivicInfo(iCivic).getUpkeep() != -1) and not activePlayer.isNoCivicUpkeep(iCivicOption)):
			szHelpText = gc.getUpkeepInfo(gc.getCivicInfo(iCivic).getUpkeep()).getDescription()
			screen.setTextAt( szPaneIDUpkeep, "CivicList", u"<font=4>" + szHelpText + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, fX + self.HEADINGS_WIDTH / 4 , fY - self.TEXT_MARGIN , 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 1.2 * self.TEXT_MARGIN
		else:
			szHelpText = localText.getText("TXT_KEY_CIVICS_SCREEN_NO_UPKEEP", ())
			screen.setTextAt( szPaneIDUpkeep, "CivicList", u"<font=4>" + szHelpText + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, fX + self.HEADINGS_WIDTH / 4  , fY - self.TEXT_MARGIN, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 1.2 * self.TEXT_MARGIN

		# Tech Prereq parseCivicInfoTechPrereq
		if (CyGameTextMgr().parseCivicInfoTechPrereq(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoTechPrereq(iCivic, False, True, True)
			screen.setTextAt( szPaneIDTechPrereq, "CivicList", u"<font=2>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + self.HEADINGS_WIDTH / 4, fY - self.TEXT_MARGIN / 2, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += self.TEXT_MARGIN

		# Building not required 
		if (CyGameTextMgr().parseCivicInfoBuildingNotRequired(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoBuildingNotRequired(iCivic, False, True, True)
			screen.setTextAt( szPaneIDInfoBuildingNotRequired, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# Specialist infos		
		if (CyGameTextMgr().parseCivicInfoNumSpecialistInfos(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumSpecialistInfos(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumSpecialistInfos, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# great People rate
		if (CyGameTextMgr().parseCivicInfoGreatPeopleRateModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoGreatPeopleRateModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDGreatPeopleRateModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# Great General Rate
		if (CyGameTextMgr().parseCivicInfoGreatGeneralRateModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoGreatGeneralRateModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDGreatGeneralRateModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# domestic great general
		if (CyGameTextMgr().parseCivicInfoDomesticGreatGeneralRateModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoDomesticGreatGeneralRateModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDDomesticGreatGeneralRateModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# religion great people		
		if (CyGameTextMgr().parseCivicInfoStateReligionGreatPeopleRateModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoStateReligionGreatPeopleRateModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDStateReligionGreatPeopleRateModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# cities maintainance
		if (CyGameTextMgr().parseCivicInfoNumCitiesMaintenanceModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumCitiesMaintenanceModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumCitiesMaintenanceModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# distance maintainance
		if (CyGameTextMgr().parseCivicInfoDistanceMaintenanceModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoDistanceMaintenanceModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDDistanceMaintenanceModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# Extra Health
		if (CyGameTextMgr().parseCivicInfoExtraHealth(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoExtraHealth(iCivic, False, True, True)
			screen.setTextAt( szPaneIDExtraHealth, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# free experience
		if (CyGameTextMgr().parseCivicInfoFreeExperience(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoFreeExperience(iCivic, False, True, True)
			screen.setTextAt( szPaneIDFreeExperience, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# worker SPeed
		if (CyGameTextMgr().parseCivicInfoWorkerSpeedModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoWorkerSpeedModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDWorkerSpeedModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

                ## EDIT MRGENIE START - SPECIAL HANDLE FOR IMPROVEMENT UPGRADE RATE ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
                ## EDIT MRGENIE START - SPECIAL HANDLE FOR IMPROVEMENT UPGRADE RATE ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
                ## EDIT MRGENIE START - SPECIAL HANDLE FOR IMPROVEMENT UPGRADE RATE ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
                ## EDIT MRGENIE START - SPECIAL HANDLE FOR IMPROVEMENT UPGRADE RATE ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
                ## EDIT MRGENIE START - SPECIAL HANDLE FOR IMPROVEMENT UPGRADE RATE ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		if (CyGameTextMgr().parseCivicInfoImprovementUpgradeRateModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoImprovementUpgradeRateModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDImprovementUpgradeRateModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoImprovementUpgradeRateModifierAppend_1(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoImprovementUpgradeRateModifierAppend_1(iCivic, False, True, True)
			screen.setTextAt( szPaneIDImprovementUpgradeRateModifierAppend_1, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + 16, fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoImprovementUpgradeRateModifierAppend_2(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoImprovementUpgradeRateModifierAppend_2(iCivic, False, True, True)
			screen.setTextAt( szPaneIDImprovementUpgradeRateModifierAppend_2, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + 16, fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN
	
                ## EDIT MRGENIE END - SPECIAL HANDLE FOR IMPROVEMENT UPGRADE RATE ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
                ## EDIT MRGENIE END - SPECIAL HANDLE FOR IMPROVEMENT UPGRADE RATE ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
                ## EDIT MRGENIE END - SPECIAL HANDLE FOR IMPROVEMENT UPGRADE RATE ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
                ## EDIT MRGENIE END - SPECIAL HANDLE FOR IMPROVEMENT UPGRADE RATE ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
                ## EDIT MRGENIE END - SPECIAL HANDLE FOR IMPROVEMENT UPGRADE RATE ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN

		# Military production rate
		if (CyGameTextMgr().parseCivicInfoMilitaryProductionModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoMilitaryProductionModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDMilitaryProductionModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# free units
		if (CyGameTextMgr().parseCivicInfoFreeUnitsPopulationPercent(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoFreeUnitsPopulationPercent(iCivic, False, True, True)
			screen.setTextAt( szPaneIDFreeUnitsPopulationPercent, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# free base military
		if (CyGameTextMgr().parseCivicInfoBaseFreeMilitaryUnits(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoBaseFreeMilitaryUnits(iCivic, False, True, True)
			screen.setTextAt( szPaneIDBaseFreeMilitaryUnits, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# Happy per Military
		if (CyGameTextMgr().parseCivicInfoHappyPerMilitaryUnit(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoHappyPerMilitaryUnit(iCivic, False, True, True)
			screen.setTextAt( szPaneIDHappyPerMilitaryUnit, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# Military food production
		if (CyGameTextMgr().parseCivicInfoMilitaryFoodProduction(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoMilitaryFoodProduction(iCivic, False, True, True)
			screen.setTextAt( szPaneIDMilitaryFoodProduction, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		#Worldsize max conscript
		if (CyGameTextMgr().parseCivicInfoWorldSizeMaxConscript(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoWorldSizeMaxConscript(iCivic, False, True, True)
			screen.setTextAt( szPaneIDWorldSizeMaxConscript, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNoUnhealthyPopulation(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNoUnhealthyPopulation(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNoUnhealthyPopulation, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoBuildingOnlyHealthy(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoBuildingOnlyHealthy(iCivic, False, True, True)
			screen.setTextAt( szPaneIDBuildingOnlyHealthy, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoExpInBorderModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoExpInBorderModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDExpInBorderModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoWarWearinessModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoWarWearinessModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDWarWearinessModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoFreeSpecialist(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoFreeSpecialist(iCivic, False, True, True)
			screen.setTextAt( szPaneIDFreeSpecialist, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoTradeRoutes(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoTradeRoutes(iCivic, False, True, True)
			screen.setTextAt( szPaneIDTradeRoutes, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNoForeignTrade(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNoForeignTrade(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNoForeignTrade, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoCivicPercentAnger(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoCivicPercentAnger(iCivic, False, True, True)
			screen.setTextAt( szPaneIDCivicPercentAnger, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoStateReligion(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoStateReligion(iCivic, False, True, True)
			screen.setTextAt( szPaneIDStateReligion, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoStateReligionHappiness(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoStateReligionHappiness(iCivic, False, True, True)
			screen.setTextAt( szPaneIDStateReligionHappiness, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNonStateReligionHappiness(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNonStateReligionHappiness(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNonStateReligionHappiness, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoStateReligionUnitProductionModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoStateReligionUnitProductionModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDStateReligionUnitProductionModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoStateReligionBuildingProductionModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoStateReligionBuildingProductionModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDStateReligionBuildingProductionModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNoStateReligionBuildingProductionModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNoStateReligionBuildingProductionModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNoStateReligionBuildingProductionModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNoStateReligionBuildingProductionModifierAppend(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNoStateReligionBuildingProductionModifierAppend(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNoStateReligionBuildingProductionModifierAppend, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoStateReligionFreeExperience(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoStateReligionFreeExperience(iCivic, False, True, True)
			screen.setTextAt( szPaneIDStateReligionFreeExperience, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNoNonStateReligionSpread(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNoNonStateReligionSpread(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNoNonStateReligionSpread, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoCityGuardModifier(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoCityGuardModifier(iCivic, False, True, True)
			screen.setTextAt( szPaneIDCityGuardModifier, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNoTechLeak(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNoTechLeak(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNoTechLeak, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoYieldChangeHelpAllCities(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoYieldChangeHelpAllCities(iCivic, False, True, True)
			screen.setTextAt( szPaneIDYieldChangeHelpAllCities, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, -1, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, 1, 1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoYieldChangeHelpCapital(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoYieldChangeHelpCapital(iCivic, False, True, True)
			screen.setTextAt( szPaneIDYieldChangeHelpCapital, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoYieldChangeHelpTradeRoutes(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoYieldChangeHelpTradeRoutes(iCivic, False, True, True)
			screen.setTextAt( szPaneIDYieldChangeHelpTradeRoutes, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoCommerceChangeHelpAllCities(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoCommerceChangeHelpAllCities(iCivic, False, True, True)
			screen.setTextAt( szPaneIDCommerceChangeHelpAllCities, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoCommerceChangeHelpCapital(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoCommerceChangeHelpCapital(iCivic, False, True, True)
			screen.setTextAt( szPaneIDCommerceChangeHelpCapital, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoCommerceChangeHelpSpecialist(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoCommerceChangeHelpSpecialist(iCivic, False, True, True)
			screen.setTextAt( szPaneIDCommerceChangeHelpSpecialist, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoLargestCityHappiness(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoLargestCityHappiness(iCivic, False, True, True)
			screen.setTextAt( szPaneIDLargestCityHappiness, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		## EDIT MRGENIE START - SPECIAL HANDLE FOR YIELD ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		## EDIT MRGENIE START - SPECIAL HANDLE FOR YIELD ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		## EDIT MRGENIE START - SPECIAL HANDLE FOR YIELD ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		## EDIT MRGENIE START - SPECIAL HANDLE FOR YIELD ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		## EDIT MRGENIE START - SPECIAL HANDLE FOR YIELD ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		if (CyGameTextMgr().parseCivicInfoNumImprovementInfosYield1Row1(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumImprovementInfosYield1Row1(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumImprovementInfosYield1Row1, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNumImprovementInfosYield1Row2(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumImprovementInfosYield1Row2(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumImprovementInfosYield1Row2, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + 16, fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNumImprovementInfosYield2Row1(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumImprovementInfosYield2Row1(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumImprovementInfosYield2Row1, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNumImprovementInfosYield2Row2(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumImprovementInfosYield2Row2(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumImprovementInfosYield2Row2, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + 16, fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNumImprovementInfosYield3Row1(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumImprovementInfosYield3Row1(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumImprovementInfosYield3Row1, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNumImprovementInfosYield3Row2(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumImprovementInfosYield3Row2(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumImprovementInfosYield3Row2, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + 16, fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN
                ## EDIT MRGENIE END - SPECIAL HANDLE FOR YIELD ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
                ## EDIT MRGENIE END - SPECIAL HANDLE FOR YIELD ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
                ## EDIT MRGENIE END - SPECIAL HANDLE FOR YIELD ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
                ## EDIT MRGENIE END - SPECIAL HANDLE FOR YIELD ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
                ## EDIT MRGENIE END - SPECIAL HANDLE FOR YIELD ARRAYS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		if (CyGameTextMgr().parseCivicInfoInquisition(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoInquisition(iCivic, False, True, True)
			screen.setTextAt( szPaneIDInquisition, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN
		if (CyGameTextMgr().parseCivicInfoInquisitionAppend1(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoInquisitionAppend1(iCivic, False, True, True)
			screen.setTextAt( szPaneIDInquisitionAppend1, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + 16, fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN
		if (CyGameTextMgr().parseCivicInfoInquisitionAppend2(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoInquisitionAppend2(iCivic, False, True, True)
			screen.setTextAt( szPaneIDInquisitionAppend2, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + 16, fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN
		if (CyGameTextMgr().parseCivicInfoInquisitionAppend3(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoInquisitionAppend3(iCivic, False, True, True)
			screen.setTextAt( szPaneIDInquisitionAppend3, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + 16, fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN
		if (CyGameTextMgr().parseCivicInfoBuildingCivicPrereq(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoBuildingCivicPrereq(iCivic, False, True, True)
			screen.setTextAt( szPaneIDBuildingCivicPrereq, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN
		if (CyGameTextMgr().parseCivicInfoBuildingCivicPrereqAppend1(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoBuildingCivicPrereqAppend1(iCivic, False, True, True)
			screen.setTextAt( szPaneIDBuildingCivicPrereqAppend1, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + 16, fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN
		if (CyGameTextMgr().parseCivicInfoBuildingCivicPrereqAppend2(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoBuildingCivicPrereqAppend2(iCivic, False, True, True)
			screen.setTextAt( szPaneIDBuildingCivicPrereqAppend2, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + 16, fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN
		if (CyGameTextMgr().parseCivicInfoBuildingCivicPrereqAppend3(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoBuildingCivicPrereqAppend3(iCivic, False, True, True)
			screen.setTextAt( szPaneIDBuildingCivicPrereqAppend3, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX + 16, fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN
                ## EDIT MRGENIE START - SPECIAL HANDLE FOR BUILDING HAPPINESS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		## EDIT MRGENIE START - SPECIAL HANDLE FOR BUILDING HAPPINESS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		## EDIT MRGENIE START - SPECIAL HANDLE FOR BUILDING HAPPINESS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		## EDIT MRGENIE START - SPECIAL HANDLE FOR BUILDING HAPPINESS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		## EDIT MRGENIE START - SPECIAL HANDLE FOR BUILDING HAPPINESS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		if (CyGameTextMgr().parseCivicInfoNumBuildingInfos(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumBuildingInfos(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumBuildingInfos, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNumBuildingInfosAppend_1(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumBuildingInfosAppend_1(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumBuildingInfosAppend_1, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNumBuildingInfosAppend_2(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumBuildingInfosAppend_2(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumBuildingInfosAppend_2, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNumBuildingInfosAppend_3(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumBuildingInfosAppend_3(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumBuildingInfosAppend_3, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNumBuildingInfosAppend_4(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumBuildingInfosAppend_4(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumBuildingInfosAppend_4, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoNumBuildingInfosAppend_5(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumBuildingInfosAppend_5(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumBuildingInfosAppend_5, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN			
                ## EDIT MRGENIE END - SPECIAL HANDLE FOR BUILDING HAPPINESS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		## EDIT MRGENIE END - SPECIAL HANDLE FOR BUILDING HAPPINESS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		## EDIT MRGENIE END - SPECIAL HANDLE FOR BUILDING HAPPINESS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		## EDIT MRGENIE END - SPECIAL HANDLE FOR BUILDING HAPPINESS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN
		## EDIT MRGENIE END - SPECIAL HANDLE FOR BUILDING HAPPINESS TO DEVIDE THEM IN SMALLER PORTIONS FOR THE CIVIC SCREEN

		if (CyGameTextMgr().parseCivicInfoNumFeatureInfos(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoNumFeatureInfos(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumFeatureInfos, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicNumHurryInfos(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicNumHurryInfos(iCivic, False, True, True)
			screen.setTextAt( szPaneIDNumHurryInfos, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoGoldPerUnit(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoGoldPerUnit(iCivic, False, True, True)
			screen.setTextAt( szPaneIDGoldPerUnit, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		if (CyGameTextMgr().parseCivicInfoGoldPerMilitaryUnit(iCivic, False, True, True) != "" ):
			szHelpText = CyGameTextMgr().parseCivicInfoGoldPerMilitaryUnit(iCivic, False, True, True)
			screen.setTextAt( szPaneIDGoldPerMilitaryUnit, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN

		# <GS Start>
		if(iCivic == gc.getInfoTypeForString("CIVIC_BUREAUCRACY") and g_bBureaucracyCivicAddsStatesmen):
			strStatesmen = "statesmen"
			if(g_iBureaucracyStatesmanBonus == 1):
				strStatesmen = "Statesman"
			strFreeStatesman = u"%c %s free %s in Capital" % (CyGame().getSymbolID(FontSymbols.BULLET_CHAR), g_iBureaucracyStatesmanBonus, strStatesmen) 
			szHelpText = strFreeStatesman
			screen.setTextAt( szPaneIDBureaucracyCivicAddsStatesmen, "CivicList", u"<font=3>" + szHelpText + u"</font>", CvUtil.FONT_LEFT_JUSTIFY, fX , fY + 6, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
			fY += 2 * self.TEXT_MARGIN
		# <GS End>


		

		# Mrgenie CivicScreenTweaks LINE:
		fX = self.INITIAL_SPACING + (self.HEADINGS_WIDTH * iCivicOption)
		fY = self.HELP_TOP - self.BIG_BUTTON_SIZE

		szHelpImageID = self.HELP_IMAGE_NAME + str(iCivicOption)
		screen.setImageButtonAt(szHelpImageID, "CivicList", gc.getCivicInfo(iCivic).getButton(), fX + self.HEADINGS_WIDTH/2 - self.BIG_BUTTON_SIZE/2, fY - self.PANEL_HEIGHT, self.BIG_BUTTON_SIZE, self.BIG_BUTTON_SIZE, WidgetTypes.WIDGET_PEDIA_JUMP_TO_CIVIC, iCivic, 1)

		
		
	# Will draw the help text
	def drawAllHelpText(self):
		for i in range (gc.getNumCivicOptionInfos()):		

			# Mrgenie CivicScreenTweaks LINE:
			screen = self.getScreen()
			
			self.drawHelpText(i)


	# Will Update the maintenance/anarchy/etc
	def updateAnarchy(self):

		screen = self.getScreen()

		activePlayer = gc.getPlayer(self.iActivePlayer)

		bChange = False
		i = 0
		while (i  < gc.getNumCivicOptionInfos() and not bChange):
			if (self.m_paeCurrentCivics[i] != self.m_paeOriginalCivics[i]):
				bChange = True
			i += 1		
		
		# Make the revolution button
		screen.deleteWidget(self.EXIT_NAME)
		if (activePlayer.canRevolution(0) and bChange):			
			screen.setText(self.EXIT_NAME, "Background", u"<font=4>" + localText.getText("TXT_KEY_CONCEPT_REVOLUTION", ( )).upper() + u"</font>", CvUtil.FONT_RIGHT_JUSTIFY, self.X_EXIT, self.Y_EXIT, self.Z_TEXT, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_REVOLUTION, 1, 0)
			screen.show(self.CANCEL_NAME)
			screen.moveToFront(self.CANCEL_NAME)
		else:
			screen.setText(self.EXIT_NAME, "Background", u"<font=4>" + localText.getText("TXT_KEY_PEDIA_SCREEN_EXIT", ( )).upper() + u"</font>", CvUtil.FONT_RIGHT_JUSTIFY, self.X_EXIT, self.Y_EXIT, self.Z_TEXT, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, 1, -1)
			screen.hide(self.CANCEL_NAME)

		# Anarchy
		iTurns = activePlayer.getCivicAnarchyLength(self.m_paeDisplayCivics);
		
		if (activePlayer.canRevolution(0)):
			szText = localText.getText("TXT_KEY_ANARCHY_TURNS", (iTurns, ))
		else:
			szText = CyGameTextMgr().setRevolutionHelp(self.iActivePlayer)

		screen.setLabel("CivicsRevText", "Background", u"<font=3>" + szText + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, self.X_SCREEN, self.BOTTOM_LINE_TOP + 9, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

		# Maintenance
		szText = localText.getText("TXT_KEY_CIVIC_SCREEN_UPKEEP", (activePlayer.getCivicUpkeep(self.m_paeDisplayCivics, True), ))
		screen.setLabel("CivicsUpkeepText", "Background", u"<font=3>" + szText + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, self.X_SCREEN, self.BOTTOM_LINE_TOP + self.BOTTOM_LINE_HEIGHT - 30, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
		
	# Revolution!!!
	def Revolution(self, inputClass):

		activePlayer = gc.getPlayer(self.iActivePlayer)

		if (inputClass.getNotifyCode() == NotifyCode.NOTIFY_CLICKED) :
			if (activePlayer.canRevolution(0)):
				messageControl = CyMessageControl()
				messageControl.sendUpdateCivics(self.m_paeDisplayCivics)			
			screen = self.getScreen()
			screen.hideScreen()


	def Cancel(self, inputClass):
		screen = self.getScreen()
		if (inputClass.getNotifyCode() == NotifyCode.NOTIFY_CLICKED) :
			for i in range (gc.getNumCivicOptionInfos()):
				self.m_paeCurrentCivics[i] = self.m_paeOriginalCivics[i]
				self.m_paeDisplayCivics[i] = self.m_paeOriginalCivics[i]
			
			self.drawContents()
			
	def getCivicsButtonName(self, iCivic):
		szName = self.BUTTON_NAME + str(iCivic)
		return szName

	def getCivicsTextName(self, iCivic):
		szName = self.TEXT_NAME + str(iCivic)
		return szName

	# Will handle the input for this screen...
	def handleInput(self, inputClass):
		if (inputClass.getNotifyCode() == NotifyCode.NOTIFY_LISTBOX_ITEM_SELECTED):
			screen = self.getScreen()
			iIndex = screen.getSelectedPullDownID(self.DEBUG_DROPDOWN_ID)
			self.setActivePlayer(screen.getPullDownData(self.DEBUG_DROPDOWN_ID, iIndex))
			self.drawContents()
			return 1
		elif (self.CivicsScreenInputMap.has_key(inputClass.getFunctionName())):	
			'Calls function mapped in CvCivicsScreen'
			# only get from the map if it has the key		

			# get bound function from map and call it
			self.CivicsScreenInputMap.get(inputClass.getFunctionName())(inputClass)
			return 1
		return 0
		
	def update(self, fDelta):
		return




